home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / include / surf.h < prev    next >
C/C++ Source or Header  |  1992-02-25  |  2KB  |  51 lines

  1. /* Copyright (c) 1992 The Geometry Center; University of Minnesota
  2.    1300 South Second Street;  Minneapolis, MN  55454, USA;
  3.    
  4. This file is part of geomview/OOGL. geomview/OOGL is free software;
  5. you can redistribute it and/or modify it only under the terms given in
  6. the file COPYING, which you should have received along with this file.
  7. This and other related software may be obtained via anonymous ftp from
  8. geom.umn.edu; email: software@geom.umn.edu. */
  9.  
  10. /* Authors: Charlie Gunn, Stuart Levy, Tamara Munzner, Mark Phillips */
  11.  
  12. #include "material.h"
  13. #include "3d.h"
  14.  
  15. /***********************************************************************
  16.  * a surf is a primitive bit of surface, conveys the geometrical
  17.  * information about an intersection
  18.  ***********************************************************************/
  19.  
  20. #define SURF_NEEDS_SET(p, n, s)    ((n)&(p) && !((s)&(p)))
  21. #define SURF_SET(p, f)        ((f) |= (p))
  22.  
  23. #define    SURF_NONE    0x0
  24. #define SURF_P      0x1
  25. #define SURF_N      0x2
  26. #define SURF_NG        0x4
  27. #define SURF_DPDU      0x8
  28. #define SURF_DPDV      0x10
  29. #define SURF_UV      0x20
  30. #define SURF_DUDV      0x40
  31. #define SURF_ST      0x80
  32. #define SURF_I      0x100
  33. #define SURF_CS      0x200
  34. #define SURF_OS      0x400
  35.  
  36. typedef struct surf {
  37.     int    flag ;        /* copied mostly from Renderman */
  38.     Point3    P ;        /* location of the point     */
  39.     Point3    dPdu ;        /* derivatives             */
  40.     Point3    dPdv ;
  41.     Point3    N ;        /* shading normal vector    */
  42.     Point3    Ng ;        /* geometric normal        */
  43.     Point2    uv ;        /* location on the surface    */
  44.     Point2    dudv ;        /* derivatives of u, v        */
  45.     Point2    st ;        /* texture coordinates         */
  46.     Point3    I ;        /* incident ray direction    */
  47.     Material mat;
  48.     Transform3 T;
  49.     Geom     *geom;
  50. } Surf ;
  51.